Skip to content

Converge CancelCheckInterval into a common constant#143

Open
yushan8 wants to merge 10 commits into
mainfrom
yushan/ctx-cancel
Open

Converge CancelCheckInterval into a common constant#143
yushan8 wants to merge 10 commits into
mainfrom
yushan/ctx-cancel

Conversation

@yushan8

@yushan8 yushan8 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Converge CancelCheckInterval into a common constant. Move service related constants to service_config.go.

@yushan8 yushan8 requested review from a team as code owners July 6, 2026 17:08
Comment thread core/targethasher/BUILD.bazel Outdated
Comment thread core/common/utils.go Outdated
@yushan8 yushan8 force-pushed the yushan/ctx-cancel branch from 931eceb to 35ec09a Compare July 7, 2026 05:29
Comment thread core/errors/errors.go Outdated
Comment thread core/errors/constants.go
@@ -0,0 +1,8 @@
package errors

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really an error package? Should it be some constant package instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think constant package is a common practice. I think usually the constants are closely related to what the package/functions are doing. In this case, we're polling to see if the context was cancelled (error) during long running loops. But yea I'll update the file to constants.go.

Comment thread core/common/utils.go Outdated

// chunk targets into multiple messages for streaming
responses := chunkTargets(optimizedTargets, DefaultTargetChunkSize)
responses := chunkTargets(optimizedTargets, config.DefaultTargetChunkSize)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this not use the service config value? If someone specified in their config, then it would get ignored here and instead use the default value still.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch

@yushan8 yushan8 force-pushed the yushan/ctx-cancel branch from 11b4aea to 1df0504 Compare July 8, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants